<%--
  User: chenyan
  Date: 2025/2/11
  Time: 21:30
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="js/jquery-3.7.1.js"></script>
    <script type="text/javascript">
        $(function (){
            $("#uname").blur(function (){
                //接受输入的信息
                var uname = $(this).val();
                //发送ajax
                // $.ajax({
                //     url:"/checkuname",
                //     type:"post",
                //     data:"username="+uname,
                //     dataType:"text",
                //     success:function (rs){
                //         $("#rs").html(rs);
                //     }
                // });
                $.get("/checkuname","username="+uname,function (rs){
                    $("#rs").html(rs);
                })
            });
        })
    </script>
    <style>
        #rs{color: red}
    </style>
</head>
<body>
    <h1>注册</h1>
    username:<input type="text" id="uname" onblur="checkname()"><span id="rs" ></span>
</body>
</html>
